feat: improved workspace ux and state identity separation. #103
Merged
knightedcodemonkey merged 5 commits intonextfrom Apr 30, 2026
Merged
feat: improved workspace ux and state identity separation. #103knightedcodemonkey merged 5 commits intonextfrom
knightedcodemonkey merged 5 commits intonextfrom
Conversation
Owner
knightedcodemonkey
commented
Apr 29, 2026
- closes Introduce clear transaction boundaries for workspace persistence (hybrid auto-save + explicit commit model) #102
- closes Simplify PR context model: remove Disconnect action and drop disconnected state #99
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors workspace persistence and UX to reduce cross-workspace state contamination, adds explicit scope identity (local vs repository) in stored records, and removes the PR “disconnect” state/action in favor of a simplified PR context model.
Changes:
- Reworked Workspaces drawer flow (Initialize/New workspace actions, scope-aware filtering, and updated copy).
- Introduced transaction/load guards and scope markers to prevent stale/late saves and identity mixing across workspace switches.
- Simplified PR context state machine by removing
disconnected(with backward-compatible normalization toinactive) and updated sync/submit flows to persist workspace metadata at explicit commit points.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/styles/ai-controls.css | Removes Disconnect styles; adds Workspaces drawer layout styles and hidden-actions behavior. |
| src/modules/workspace/workspaces-drawer/drawer.js | Implements new Workspaces drawer UI state machine and actions (Initialize/New/Open/Remove). |
| src/modules/workspace/workspace-storage.js | Normalizes and persists new workspaceScope field on workspace records. |
| src/modules/github/pr/editor-sync.js | Refactors editor sync to support multiple tab targets by path and returns richer sync results. |
| src/modules/github/pr/drawer/controller/run-submit.js | Persists workspace metadata on submit; tightens push-commit baseline update expectations. |
| src/modules/github/pr/drawer/controller/repository-form.js | Resets form fields when active PR context identity changes (sync key tracking). |
| src/modules/github/pr/drawer/controller/public-actions.js | Removes disconnectActivePrContext public action. |
| src/modules/github/pr/drawer/controller/create-controller.js | Adds state key tracking; aborts pending verify/sync requests on context changes. |
| src/modules/github/pr/drawer/controller/context-sync.js | Dedupes/sorts tab sync targets and keys sync by target paths. |
| src/modules/github/pr/drawer/common.js | Removes disconnected from supported states; normalizes legacy disconnected -> inactive. |
| src/modules/github/api/editor-content.js | Hardens Git Database API commit path for deletes and removes branch-name retry behavior. |
| src/modules/constants.js | Removes obsolete starter-selection prefix constant. |
| src/modules/app-core/workspace-tabs-renderer.js | Updates “Edited” indicator logic to respect synced baseline content. |
| src/modules/app-core/workspace-sync-controller.js | Scope-aware snapshotting; canonical dirty-state derivation; sync targets and reconcile by path. |
| src/modules/app-core/workspace-scope-fork-actions.js | Adds Initialize/New workspace fork actions with scope/key/PR-state semantics. |
| src/modules/app-core/workspace-save-controller.js | Adds load-transaction staleness guard and stricter workspace-key adoption rules. |
| src/modules/app-core/workspace-pr-session-handoff-controller.js | Ensures archived and fresh local sessions set workspaceScope appropriately. |
| src/modules/app-core/workspace-editor-helpers.js | Aligns edited indicator logic and suppresses editor side effects during tab loads. |
| src/modules/app-core/workspace-controllers-setup.js | Introduces workspace load transaction id; wires cancelPendingWorkspaceSave. |
| src/modules/app-core/workspace-context-controller.js | Uses load transaction boundary + cancels pending saves during apply; scope marker hydration. |
| src/modules/app-core/github-workflows.js | Updates Workspaces drawer wiring, initialize/new flows, and post-submit workspace persistence. |
| src/modules/app-core/github-workflows-setup.js | Threads new workspace actions/flush/save functions into workflows setup. |
| src/modules/app-core/github-pr-context-ui.js | Removes Disconnect UI wiring; retains close behavior. |
| src/modules/app-core/app-bindings-startup.js | Stops auto-persisting PR drawer metadata fields on input/blur (moves to explicit commit). |
| src/index.html | Swaps header toggles, removes Disconnect button, and updates Workspaces drawer UI controls. |
| src/app.js | Adds workspaceScopeMarker, integrates scope fork actions, and updates workspace/PR restore semantics. |
| playwright/helpers/app-test-helpers.ts | Stabilizes drawer open/close helpers and adapts bootstrap to Initialize/New flows. |
| playwright/github-pr-drawer/open-pr-create.spec.ts | Adds/updates coverage for scope init/new workspace UX, submit persistence, and branch-exists failures. |
| playwright/github-pr-drawer/github-pr-drawer.helpers.ts | Updates selectors/seed helpers for new labels and adds workspaceScope seeding support. |
| playwright/github-pr-drawer/active-context-sync.spec.ts | Expands sync/push/delete pruning tests and adds regression coverage for partial sync behavior. |
| playwright/github-pr-drawer/active-context-switch.spec.ts | Removes disconnected scenarios; adds stronger workspace-switch integrity and isolation tests. |
| playwright/github-pr-drawer/active-context-switch-debounce-essential.spec.ts | Adds regression suite for debounced-save switching and late-verify isolation. |
| playwright/github-byot-ai.spec.ts | Updates Workspaces startup flow to use Initialize. |
| docs/workspaces-behavior-algorithm.md | Documents the Workspaces drawer behavior/state machine and invariants. |
| docs/pr-context-storage-matrix.md | Updates documented PR context states and baseline invariants post-push. |
| docs/localstorage-state.md | Updates PR context state list and links to Workspaces behavior spec. |
| docs/issue-99-workspaces-drawer-plan.md | Adds implementation plan doc for Issue #99 Workspaces UX changes. |
| docs/idb-workspace-state.md | Documents workspaceScope and post-push baseline/dirty-state invariants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.